<?php
/**
 * @annotate 后台彩票抽奖列表。添加。修改。删除
 * @group   Admin/Haiyin
 * @author   mengke.yue <mengke.yue@gmail.com>
 */
class LotteryAction extends BaseAction {
	
	public function add_lottery(){
		$this->assign('Title',"添加彩票");
		$this->checkPost();
        $Admin = D('User');
		$num = $_POST['num'];
		$num = trim($num);
		$num = explode('#', $num);
		foreach ($num as $k => &$v) {
			$data['ctime'] = time();
			$data['num'] = $v;
			if($v !=""){
				$result=D('lottery')->add($data);
			}
		}
        if ($result) {
        	$this->success("添加成功！","__URL__/lottery_list");
		}
	}

	public function lottery_list(){
		$this->assign('Title',"彩票列表");
		$list = D('lottery')->order('ctime desc')->findPage(20);
		$this->assign('list',$list);
		$this->display();
	}
	public function lottery_people_list(){
		$list = D('lottery')->where('status = 1')->order('ctime desc')->findPage(20);
		$this->assign('list',$list);
		$this->display();
	}
	
}
?>